<?php

if (!init()) {
  redirect('?action=login');
}

$addTopicResultSet = createNewTopic($_POST['header'], $_POST['content'], $_POST['section']);


$initiatorAction = \controller\ControllerUtil::getEncodedActionFromUrlWithParameters($_SERVER['HTTP_REFERER']);

if ($addTopicResultSet) {
  redirect("?action=msg&header=header.create.topic.success&body=body.create.topic.success&view=" . $initiatorAction);
} else {
  redirect("?action=msg&header=header.create.topic.failed&body=body.create.topic.failed&view=" . $initiatorAction);
}